var t = require;
var e = module;
var o = exports;
var n =
        (this && this.__extends) ||
        (function () {
            var t = function (e, o) {
                return (t =
                    Object.setPrototypeOf ||
                    ({__proto__: []} instanceof Array &&
                        function (t, e) {
                            t.__proto__ = e;
                        }) ||
                    function (t, e) {
                        for (var o in e) e.hasOwnProperty(o) && (t[o] = e[o]);
                    })(e, o);
            };
            return function (e, o) {
                function n() {
                    this.constructor = e;
                }
                t(e, o), (e.prototype = null === o ? Object.create(o) : ((n.prototype = o.prototype), new n()));
            };
        })(),
    r =
        (this && this.__decorate) ||
        function (t, e, o, n) {
            var r,
                a = arguments.length,
                i = a < 3 ? e : null === n ? (n = Object.getOwnPropertyDescriptor(e, o)) : n;
            if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) i = Reflect.decorate(t, e, o, n);
            else
                for (var s = t.length - 1; s >= 0; s--)
                    (r = t[s]) && (i = (a < 3 ? r(i) : a > 3 ? r(e, o, i) : r(e, o)) || i);
            return a > 3 && i && Object.defineProperty(e, o, i), i;
        };
Object.defineProperty(o, "__esModule", {value: !0});
var a = t("Const"),
    i = t("Platforms"),
    s = cc._decorator,
    c = s.ccclass,
    l =
        (s.property,
        (function (t) {
            function e() {
                return (null !== t && t.apply(this, arguments)) || this;
            }
            return (
                n(e, t),
                (e.prototype.init = function (t, e, o, n, r) {
                    (this.index = t),
                        (this.name1 = e),
                        (this.name2 = o),
                        (this.gems = n),
                        (this.coins = r),
                        (this.txt1 = this.node.getChildByName("txt1").getComponent(cc.Label)),
                        (this.txt2 = this.node.getChildByName("txt2").getComponent(cc.Label)),
                        a.default.wid0 > a.default.hei0 || ((this.txt1.node.x = 60), (this.txt2.node.x = -90)),
                        (this.txt1.string = this.name1),
                        (this.txt2.string = this.name2);
                    var i = this.node.getChildByName("chests").children;
                    (this.chest1 = i[0]), (this.chest2 = i[1]), (this.chest3 = i[2]);
                }),
                (e.prototype.refresh = function () {
                    switch ((this.chest1.stopAllActions(), i.default.userStorage.节日宝箱[this.index])) {
                        case "未打开":
                            (this.chest1.active = !0),
                                (this.chest2.active = !1),
                                (this.chest3.active = !1),
                                (this.txt2.node.active = !0);
                            break;
                        case "已打开":
                            (this.chest1.active = !1),
                                (this.chest2.active = !0),
                                (this.chest3.active = !1),
                                (this.txt2.node.active = !1);
                            break;
                        case "已领取":
                            (this.chest1.active = !1),
                                (this.chest2.active = !1),
                                (this.chest3.active = !0),
                                (this.txt2.node.active = !1);
                    }
                }),
                (e.prototype.open = function (t) {
                    this.chest1.stopAllActions(),
                        this.chest1.runAction(
                            cc.sequence(
                                cc.scaleTo(1.2, 0.6, 2).easing(cc.easeCubicActionOut()),
                                cc.scaleTo(0.1, 1, 1).easing(cc.easeBackOut()),
                                cc.callFunc(t)
                            )
                        );
                }),
                (e = r([c], e))
            );
        })(cc.Component));
o.default = l;
